*****5MAY2015
//XT Setting the Data
drop if year==.
sort ccode year
xtset ccode year, yearly


//Pairwise Correlation 
pwcorr ln_neonat_mortrate_wb ln_infant_mort_rate_wb ln_underfive_mortrate_wb agg_imprate_lag reb_viclag govt_viclag accord_lag ongoingconf_lag Territorial_Conflict GDPpercapita1000clag1 ex_constrain5_7_lag pupil_primary100000lag1 firstfive_peaceyear pop_mil_lag1  wardur_months deathslow_1000  healthexp_pergovexpLAG1 if year>1988 & outcome!=.& countryname!="South Sudan" 
sum ln_neonat_mortrate_wb ln_infant_mort_rate_wb ln_underfive_mortrate_wb agg_imprate_lag reb_viclag govt_viclag accord_lag ongoingconf_lag Territorial_Conflict GDPpercapita1000clag1 ex_constrain5_7_lag pupil_primary100000lag1 firstfive_peaceyear pop_mil_lag1  wardur_months deathslow_1000  healthexp_pergovexpLAG1 if year>1988 & outcome!=.& countryname!="South Sudan" 
gen use = 1 if ln_neonat_mortrate_wb!=. & ln_infant_mort_rate_wb !=. & ln_underfive_mortrate_wb !=. & agg_imprate_lag!=. & reb_viclag!=. & govt_viclag!=. & accord_lag!=. & ongoingconf_lag!=. & Territorial_Conflict!=. & GDPpercapita1000clag1!=. & ex_constrain5_7_lag!=. & pupil_primary100000lag1!=. & firstfive_peaceyear!=. & pop_mil_lag1!=. & wardur_months!=. & deathslow_1000!=. &  healthexp_pergovexpLAG1!=. & year>1988 & outcome!=.& countryname!="South Sudan"

//Models with neonatal, infant, underfive mortality rate & life expectancy

//eststo: quietly xtreg ln_neonat_mortrate_wb agg_imprate_lag if year>1988 & outcome!=., fe
eststo: quietly xtreg ln_neonat_mortrate_wb agg_imprate_lag wardur_months deathslow_1000 Territorial_Conflict if year>1988 & outcome!=.& countryname!="South Sudan", fe
eststo: quietly xtreg ln_neonat_mortrate_wb agg_imprate_lag reb_viclag govt_viclag accord_lag ongoingconf_lag Territorial_Conflict GDPpercapita1000clag1 ex_constrain5_7_lag pupil_primary100000lag1   if year>1988 & outcome!=.& countryname!="South Sudan", fe
eststo: quietly xtreg ln_neonat_mortrate_wb agg_imprate_lag reb_viclag govt_viclag accord_lag ongoingconf_lag Territorial_Conflict GDPpercapita1000clag1 ex_constrain5_7_lag pupil_primary100000lag1 firstfive_peaceyear   wardur_months deathslow_1000  healthexp_pergovexpLAG1 if year>1988 & outcome!=.& countryname!="South Sudan", fe 

//eststo: quietly xtreg ln_infant_mort_rate_wb agg_imprate_lag if year>1988 & outcome!=., fe
eststo: quietly xtreg ln_infant_mort_rate_wb agg_imprate_lag wardur_months deathslow_1000 Territorial_Conflict if year>1988 & outcome!=.& countryname!="South Sudan", fe
eststo: quietly xtreg ln_infant_mort_rate_wb agg_imprate_lag reb_viclag govt_viclag accord_lag ongoingconf_lag Territorial_Conflict GDPpercapita1000clag1 ex_constrain5_7_lag pupil_primary100000lag1  if year>1988 & outcome!=.& countryname!="South Sudan", fe
eststo: quietly xtreg ln_infant_mort_rate_wb agg_imprate_lag reb_viclag govt_viclag accord_lag ongoingconf_lag Territorial_Conflict GDPpercapita1000clag1 ex_constrain5_7_lag pupil_primary100000lag1 firstfive_peaceyear  wardur_months deathslow_1000  healthexp_pergovexpLAG1 if year>1988 & outcome!=.& countryname!="South Sudan", fe

//eststo: quietly xtreg ln_underfive_mortrate_wb agg_imprate_lag if year>1988 & outcome!=., fe
eststo: quietly xtreg ln_underfive_mortrate_wb agg_imprate_lag wardur_months deathslow_1000 Territorial_Conflict if year>1988 & outcome!=.& countryname!="South Sudan", fe
eststo: quietly xtreg ln_underfive_mortrate_wb agg_imprate_lag reb_viclag govt_viclag accord_lag ongoingconf_lag Territorial_Conflict GDPpercapita1000clag1 ex_constrain5_7_lag pupil_primary100000lag1 if year>1988 & outcome!=.& countryname!="South Sudan", fe
eststo: quietly xtreg ln_underfive_mortrate_wb agg_imprate_lag reb_viclag govt_viclag accord_lag ongoingconf_lag Territorial_Conflict GDPpercapita1000clag1 ex_constrain5_7_lag pupil_primary100000lag1 firstfive_peaceyear  wardur_months deathslow_1000  healthexp_pergovexpLAG1 if year>1988 & outcome!=.& countryname!="South Sudan", fe


esttab using Child-Mortality12MAY2015.rtf, b(a3) nogaps title (Table 1: Child Mortality in Post-Conflict Countries)cells(b(star fmt(3)) se(par fmt(3))) legend label varlabels(_cons Constant) star(* 0.05 ** 0.01 *** 0.001) compress replace
eststo clear


//Similar number of observations
//eststo: quietly xtreg ln_neonat_mortrate_wb agg_imprate_lag if year>1988 & outcome!=., fe
eststo: quietly xtreg ln_neonat_mortrate_wb agg_imprate_lag wardur_months deathslow_1000 Territorial_Conflict if year>1988 & outcome!=.& countryname!="South Sudan" & use==1, fe
eststo: quietly xtreg ln_neonat_mortrate_wb agg_imprate_lag reb_viclag govt_viclag accord_lag ongoingconf_lag Territorial_Conflict GDPpercapita1000clag1 ex_constrain5_7_lag pupil_primary100000lag1   if year>1988 & outcome!=.& countryname!="South Sudan" & use==1, fe
eststo: quietly xtreg ln_neonat_mortrate_wb agg_imprate_lag reb_viclag govt_viclag accord_lag ongoingconf_lag Territorial_Conflict GDPpercapita1000clag1 ex_constrain5_7_lag pupil_primary100000lag1 firstfive_peaceyear   wardur_months deathslow_1000  healthexp_pergovexpLAG1 if year>1988 & outcome!=.& countryname!="South Sudan" & use==1, fe 

//eststo: quietly xtreg ln_infant_mort_rate_wb agg_imprate_lag if year>1988 & outcome!=., fe
eststo: quietly xtreg ln_infant_mort_rate_wb agg_imprate_lag wardur_months deathslow_1000 Territorial_Conflict if year>1988 & outcome!=.& countryname!="South Sudan" & use==1, fe
eststo: quietly xtreg ln_infant_mort_rate_wb agg_imprate_lag reb_viclag govt_viclag accord_lag ongoingconf_lag Territorial_Conflict GDPpercapita1000clag1 ex_constrain5_7_lag pupil_primary100000lag1  if year>1988 & outcome!=.& countryname!="South Sudan" & use==1, fe
eststo: quietly xtreg ln_infant_mort_rate_wb agg_imprate_lag reb_viclag govt_viclag accord_lag ongoingconf_lag Territorial_Conflict GDPpercapita1000clag1 ex_constrain5_7_lag pupil_primary100000lag1 firstfive_peaceyear  wardur_months deathslow_1000  healthexp_pergovexpLAG1 if year>1988 & outcome!=.& countryname!="South Sudan" & use==1, fe

//eststo: quietly xtreg ln_underfive_mortrate_wb agg_imprate_lag if year>1988 & outcome!=., fe
eststo: quietly xtreg ln_underfive_mortrate_wb agg_imprate_lag wardur_months deathslow_1000 Territorial_Conflict if year>1988 & outcome!=.& countryname!="South Sudan" & use==1, fe
eststo: quietly xtreg ln_underfive_mortrate_wb agg_imprate_lag reb_viclag govt_viclag accord_lag ongoingconf_lag Territorial_Conflict GDPpercapita1000clag1 ex_constrain5_7_lag pupil_primary100000lag1 if year>1988 & outcome!=.& countryname!="South Sudan" & use==1, fe
eststo: quietly xtreg ln_underfive_mortrate_wb agg_imprate_lag reb_viclag govt_viclag accord_lag ongoingconf_lag Territorial_Conflict GDPpercapita1000clag1 ex_constrain5_7_lag pupil_primary100000lag1 firstfive_peaceyear  wardur_months deathslow_1000  healthexp_pergovexpLAG1 if year>1988 & outcome!=.& countryname!="South Sudan" & use==1, fe


esttab using Child-Mortality12MAY2015-USE.rtf, b(a3) nogaps title (Table 1: Child Mortality in Post-Conflict Countries)cells(b(star fmt(3)) se(par fmt(3))) legend label varlabels(_cons Constant) star(* 0.05 ** 0.01 *** 0.001) compress replace
eststo clear
